package cn.bgs.service;

import cn.bgs.pojo.Maintenance;
import cn.bgs.pojo.ProjectType;
import cn.bgs.vo.MaintenanceIntermediateVo;
import cn.bgs.vo.MaintenanceListVo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 维修记录表 服务类
 * </p>
 *
 * @author cf
 * @since 2022-06-07
 */
public interface IMaintenanceService extends IService<Maintenance> {

    /**
     * 查询所有
     * @param userId
     * @return
     */
    List<MaintenanceListVo> getMaintenanceList(Integer userId);

    /**
     * 查询级联维修类型和项目
     * @return
     */
    List<ProjectType> getMaintenceTree();

    /**
     * 添加维修申请
     * @param maintenanceIntermediateVo
     * @return
     */
    int saveMaintence(MaintenanceIntermediateVo maintenanceIntermediateVo);

    /**
     * 撤销申请
     * @param maintenanceId
     * @return
     */
    int deleteMaintence(Integer maintenanceId);


    List<Maintenance> findAll(Integer communityId);

    Boolean into(@Param("theTitle") String theTitle, @Param("problemDescription") String problemDescription, @Param("phone") Integer phone, @Param("appointmentTime") Date appointmentTime);

    Boolean delete(Integer maintenanceId);

    String file(MultipartFile file);

    List<Maintenance> findById(Integer id);

    Boolean shenhe(Integer id, Integer shenhe);


}
